@extends('layouts.tankuang')

@section('content')
    <form name="add_form" id="add_form" action="{{url('admin/units/add_baowei',$id)}}" method="post" enctype="multipart/form-data">
        <input type="hidden" name="_token" value="{{ csrf_token() }}">
        <div>
            <h2 class="text-center mg_b36 mg_t25" style="font-weight: bold;">
                保安公司考核（满分100分）
            </h2>
            <input type="hidden" name="_token" value="{{ csrf_token() }}">
            <table class="table-form table-border w mg-auto">
                <tr>
                    <td class="font-bd" rowspan="2" width="10%">基本信息</td>
                    <td class="font-bd">考核人</td>
                    <td>
                        <input type="text" class="form-input" value="" name="kaoheren">
                    </td>
                </tr>
                <tr>
                    <td class="font-bd">考核时间</td>
                    <td>
                        <input class="easyui-datebox w153" value="" name="kaohe_time">
                    </td>
                </tr>

                <tr>
                    <td class="font-bd" rowspan="2" width="4%">安全事故</td>
                    <td class="font-bd">严重安全事故（每起扣40分）</td>
                    <td>
                        <input type="text" class="form-input" value="" name="yanzhongshigu" onkeyup="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')">&nbsp;&nbsp;&nbsp;（起）
                    </td>
                </tr>
                <tr>
                    <td class="font-bd">一般安全事故（每起扣20分）</td>
                    <td>
                        <input type="text" class="form-input" value="" name="yibanshigu" onkeyup="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')">&nbsp;&nbsp;&nbsp;（起）
                    </td>
                </tr>

                <tr>
                    <td class="font-bd">其他</td>
                    <td>备注</td>
                    <td>
                        <textarea class="textarea" name="remark"></textarea>
                    </td>
                </tr>
            </table>

            <div class="w wbt mg_t25">
                <button id="go" type="button" class="easyui-linkbutton dsp font-bd" data-options="iconCls:'icon-save'">确定</button>
                <button type="button" class="easyui-linkbutton dsp" data-options="iconCls:'icon-no'" onclick="$('#kh').window('close')">关闭</button>
            </div>
        </div>
    </form>

    <script>
        $('#go').click(function (){
            $.ajax({
                cache: true,
                type: "POST",
                url: "{{url('admin/baoan/add_gongsi_kaohe',$id)}}",
                data:$('#add_form').serialize(),
                async: false,
                success: function(data) {
                    if(data.status == 1){
                        $.messager.alert('信息提示',data.msg,'info');
                        $('#kh').dialog('close');
                        $('.pagination-load').click();
                    }else{
                        $.messager.alert('信息提示',data.msg,'info');
                    }
                },
                error: function(msg) {
                    var json=JSON.parse(msg.responseText);
                    $.each(json, function(index, value) {
                        $.messager.alert('信息提示',value,'info');die;
                    });
                },
            });
        });
    </script>
@stop